/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pl.edu.amu.wmi.kino.visualjavafx.javafxcodeparsers.tools;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 *
 * @author Admin
 */
public class CanParseMatcher {
    public static boolean matches(String s, final String regex){
         Pattern pattern =Pattern.compile(regex);
         Matcher matcher =pattern.matcher(s);
         return matcher.find();
    }
    public static String extractMatch(String s, final String regex){
        Pattern pattern =Pattern.compile(regex);
         Matcher matcher =pattern.matcher(s);
         matcher.find();
         return matcher.group();
    }
}
